<template>
  <div class="no-result">
    <div class="no-result-content">
      <div class="icon"></div>
      <p class="desc">{{ title }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'NoResult',
  data () {
    return {
      // 提供一个默认值, 使用v-loading可以动态传参, 覆盖这个默认值
      title: '抱歉，没有结果'
    }
  },
  methods: {
    setTitle (title) {
      this.title = title
    }
  }
}
</script>

<style lang="scss" scoped>
.no-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);

  .no-result-content {
    text-align: center;

    .icon {
      width: 90px;
      height: 90px;
      margin: 0 auto;
      background-image: url('no-data.png');
      background-size: 90px 90px;
    }

    .desc {
      line-height: 20px;
      font-size: $font-size-medium;
      color: $color-text-d;
    }
  }
}

</style>
